package com.elvin.zoe;

import java.awt.Color;

public class ColorGenerator {

	private static float hue = 0.0f;
	private static float saturation = 0.5f;
	private static float brightness = 0.5f;

	private static int index = 0;

	public static void reset() {
		index = 0;
	}

	public static Color nextColor() {
		hue = (index++ / 33.0f + 1) % 1;
		return Color.getHSBColor(hue, saturation, brightness);
	}
	
	public static String nextColorInRgb(){
		Color nextColor = nextColor();
		int red = nextColor.getRed();
		int green = nextColor.getGreen();
		int blue = nextColor.getBlue();
		return Integer.toHexString(red) + Integer.toHexString(green) + Integer.toHexString(blue);
	}
	
	public static void main(String[] args) {
		
		String html = "<div style='width:300px; height:30px; background-color:#[COLOR]'></div>";
		StringBuffer buf = new StringBuffer();
		for(int i = 0 ; i < 33 ; i++){
			String colorStr = ColorGenerator.nextColorInRgb();
			System.out.print("\"#"+colorStr+ "\",");
			buf.append(html.replace("[COLOR]", colorStr));
		}
		System.out.println();
		System.out.println(buf.toString());
	}

}
